package tesys.objects;

/**
 * @author Group5 Comp3350
 *
 */
public class Election {

	private String pid;//project id
	private String iid;//iteration id
	private String id;
 
	//constructor
	public Election(String name, String iid, String pID, String ID)
	{
		this.pid=pID;//project id
		this.iid=iid;//iteration id
		this.id=ID;
	}	
	public Election(String ID)
	{
		this.id=ID;
	}	
	//accessor

	public String getIID(){return iid;}
	public String getPID(){return pid;}
	public String getID(){return id;}

	//compareTo()
	//to check if 2 objects are same
	public boolean compareTo(Object obj)
	{
		boolean result;
		Election t;
		
		result = false;
		
		if (obj instanceof Election)
		{
			t = (Election) obj;
			if (t.getID().equalsIgnoreCase(id))
			{
				result = true;
			}
		}
		return result;
	}

	//toString()
	public String toString () 
	{
		return "Election for Project "+pid+" "+"Iteration "+iid+" ";
	}

}


